local skel = fk.CreateSkill{
  name = "ksp__zhongqi",
}

Fk:loadTranslationTable{
  ["ksp__zhongqi"] = "终弃",
  [":ksp__zhongqi"] = "一名角色的回合结束时，若你没有手牌，你可以入魔，失去“始乱”并令所有其他角色获得“始乱”，失去“终弃”并令一名其他角色获得“终弃”。",
  ["#ksp__zhongqi"] = "终弃：你可以入魔，失去“始乱”并令所有其他角色获得“始乱”，失去“终弃”并令一名其他角色获得“终弃”",

  ["$ksp__zhongqi1"] = "血流成河，方不负我倾世的容颜。",
  ["$ksp__zhongqi2"] = "看你们为我疯魔厮杀，才是这世间最美的风景。",
}

skel:addEffect(fk.TurnEnd,{
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(skel.name) and player:isKongcheng() and not player:hasSkill("#rumo", true)
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local p,_,yn = room:askToChooseCardsAndPlayers(player,{
      min_card_num = 0,
      max_card_num = 0,
      min_num = 1,
      max_num = 1,
      targets = room:getOtherPlayers(player),
      cancelable = true,
      prompt = "#ksp__zhongqi",
      skill_name = skel.name,
    })
    if yn then
      event:setCostData(self,{to = p[1]})
      return true
    end
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    room:handleAddLoseSkills(player, "#rumo", nil, false, true)--入魔
    room:handleAddLoseSkills(player,"-ksp__shiluan")
    for _,p in ipairs(room:getOtherPlayers(player))do
      room:handleAddLoseSkills(p,"ksp__shiluan")
    end
    local p = event:getCostData(self).to
    room:handleAddLoseSkills(player,"-ksp__zhongqi")
    room:handleAddLoseSkills(p,"ksp__zhongqi")
  end
})

return skel